package org.example.controller.minioFile;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.model.common.ResponseResult;
import org.example.service.minio.MinioFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * Minio文件管理
 */
@CrossOrigin
@RestController
@RequestMapping("/file")
@Api(value = "Minio文件管理接口", tags = {"Minio文件管理接口"})
public class MinioFileController {

    @Autowired
    private MinioFileService minioFileService;

    /**
     * 文件上传
     */
    @PostMapping("/upload-file")
    @ApiOperation("文件上传")
    public ResponseResult<String> UploadImage(@RequestParam("file") MultipartFile file) {
        return minioFileService.UploadFile(file);
    }
}

